package com.shaoshaohuo.app.net;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.util.Log;

import com.shaoshaohuo.app.entity.BaseEntity;
import com.shaoshaohuo.app.entity.OrderShopInfoEntity;
import com.shaoshaohuo.app.entity.SmsCodeEntity;
import com.shaoshaohuo.app.utils.Okhttputils;

import java.io.File;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 请求具体方法类
 * Created by Administrator on 2017/6/7.
 */

public class ShopHttpConfig {

    public static void addshop(Context context, String catid, Okhttputils.OkutListener ok) {
        Map<String, String> headerParams = RequestParam.getHeaderParams();
        HashMap<String, String> stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("catid", catid);
        Okhttputils.Instanse(context).postFromBody(headerParams, HttpConfig.BASE_HOST_URL + NewHttpCofig.App_CarAdd, stringStringHashMap, ok, BaseEntity.class);
    }

    public static void wheathershop(Context context, String catid, Okhttputils.OkutListener ok) {
        Map<String, String> headerParams = RequestParam.getHeaderParams();
        HashMap<String, String> stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("catid", catid);
        Okhttputils.Instanse(context).postFromBody(headerParams, HttpConfig.BASE_HOST_URL + NewHttpCofig.App_CarWheather, stringStringHashMap, ok, BaseEntity.class);
    }

    public static void deletshop(Context context, String catid, Okhttputils.OkutListener ok) {
        Map<String, String> headerParams = RequestParam.getHeaderParams();
        HashMap<String, String> stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("orderids", catid);
        Okhttputils.Instanse(context).postFromBody(headerParams, HttpConfig.BASE_HOST_URL + NewHttpCofig.App_CarDelete, stringStringHashMap, ok, BaseEntity.class);
    }

    /**
     * App_Collectionadd
     * 收藏
     */
    public static void Collectionadd(Context context, String catid, Okhttputils.OkutListener ok) {
        Map<String, String> headerParams = RequestParam.getHeaderParams();
        HashMap<String, String> stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("catid", catid);
        Okhttputils.Instanse(context).postFromBody(headerParams, HttpConfig.BASE_HOST_URL + NewHttpCofig.App_Collectionadd, stringStringHashMap, ok, BaseEntity.class);
    }

    //ec_collection/del
    public static void Collectiondelte(Context context, String catid, Okhttputils.OkutListener ok) {
        Map<String, String> headerParams = RequestParam.getHeaderParams();
        HashMap<String, String> stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("catids", catid);
        Okhttputils.Instanse(context).postFromBody(headerParams, HttpConfig.BASE_HOST_URL + NewHttpCofig.App_Collecdelete, stringStringHashMap, ok, BaseEntity.class);
    }

    //App_Addresssearch
    public static void Addresssearch(Context context, String isdefault, Okhttputils.OkutListener ok, Class<? extends BaseEntity> clx) {
        Map<String, String> headerParams = RequestParam.getHeaderParams();
        HashMap<String, String> stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("isdefault", isdefault);
        Okhttputils.Instanse(context).postFromBody(headerParams, HttpConfig.BASE_HOST_URL + NewHttpCofig.App_Addresssearch, stringStringHashMap, ok, clx);
    }

    /**
     * 开放城市查询
     */
    //provinceid(省id)   cityid(市id)
    ///address/getarea
    public static void App_addressgetarea(Context context, String provinceid, String cityid, Okhttputils.OkutListener ok, Class<? extends BaseEntity> clx) {
        Map<String, String> headerParams = RequestParam.getHeaderParams();
        HashMap<String, String> stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("provinceid", provinceid);
        stringStringHashMap.put("cityid", cityid);
        Okhttputils.Instanse(context).postFromBody(headerParams, HttpConfig.BASE_HOST_URL + NewHttpCofig.App_addressgetarea, stringStringHashMap, ok, clx);
    }

    /**
     * 地址添加
     */
    //provin
    ///address/adds
    //  String App_addressadds = "/address/adds";
    public static void App_addressadds(Context context, String name, String phone, String areaid, String details, String adressnum, String longitude, String latitude, String defaulta, String type, Okhttputils.OkutListener ok, Class<? extends BaseEntity> clx) {
        Map<String, String> headerParams = RequestParam.getHeaderParams();
        HashMap<String, String> stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("name", name);
        stringStringHashMap.put("phone", phone);
        stringStringHashMap.put("areaid", areaid);
        stringStringHashMap.put("details", details);
        stringStringHashMap.put("adressnum", adressnum);
        stringStringHashMap.put("longitude", longitude);
        stringStringHashMap.put("latitude", latitude);
        stringStringHashMap.put("default", defaulta);
        stringStringHashMap.put("type", type);
        Okhttputils.Instanse(context).postFromBody(headerParams, HttpConfig.BASE_HOST_URL + NewHttpCofig.App_addressadds, stringStringHashMap, ok, clx);


    }

    public static void App_addressupdate(Context context, String name, String phone, String areaid, String details, String adressnum, String longitude, String latitude, String defaulta, String addressid, String type, Okhttputils.OkutListener ok, Class<? extends BaseEntity> clx) {
        Map<String, String> headerParams = RequestParam.getHeaderParams();

        Log.e("TAG", "App_addressupdate: ======" + addressid);
        HashMap<String, String> stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("name", name);
        stringStringHashMap.put("phone", phone);
        stringStringHashMap.put("areaid", areaid);
        stringStringHashMap.put("details", details);
        stringStringHashMap.put("adressnum", adressnum);
        stringStringHashMap.put("longitude", longitude);
        stringStringHashMap.put("latitude", latitude);
        stringStringHashMap.put("default", defaulta);
        stringStringHashMap.put("type", type);
        stringStringHashMap.put("addressid", addressid);
        Okhttputils.Instanse(context).postFromBody(headerParams, HttpConfig.BASE_HOST_URL + NewHttpCofig.App_addressupdate, stringStringHashMap, ok, clx);


    }

    //String App_addressdel = "/address/del"
    public static void App_addressdel(Context context, String addressid, Okhttputils.OkutListener ok, Class<? extends BaseEntity> clx) {
        Map<String, String> headerParams = RequestParam.getHeaderParams();
        HashMap<String, String> stringStringHashMap = new HashMap<>();

        stringStringHashMap.put("addressid", addressid);
        Okhttputils.Instanse(context).postFromBody(headerParams, HttpConfig.BASE_HOST_URL + NewHttpCofig.App_addressdel, stringStringHashMap, ok, clx);
    }

    /**
     * 收藏查詢
     *
     * @param context
     * @param listener
     * @param cls
     */
    public static void querey(Context context, Okhttputils.OkutListener listener, Class<? extends BaseEntity> cls) {
        Map<String, String> headerParams = RequestParam.getHeaderParams();
        Okhttputils.Instanse(context).getnet(headerParams, context, HttpConfig.BASE_HOST_URL + NewHttpCofig.App_collectionsearchl, listener, cls);
    }

    /**
     * 提交订单
     */
    // App_Orederadd
    public static void App_Orederadd(Context context, String orderids, String catid, String buy_num, String addressid, String couponid, String integralid, String totallmoney, String finallymoney, String freight, String ordertype, Okhttputils.OkutListener ok, Class<? extends BaseEntity> clx) {
        Map<String, String> headerParams = RequestParam.getHeaderParams();
        HashMap<String, String> stringStringHashMap = new HashMap<>();
        if (orderids != null) {
            stringStringHashMap.put("orderids", orderids);
        }
        if (catid != null && buy_num != null) {
            stringStringHashMap.put("catid", catid);
            stringStringHashMap.put("buy_num", buy_num);
        }
        stringStringHashMap.put("addressid", addressid);
        stringStringHashMap.put("couponid", couponid);
        stringStringHashMap.put("integralid", integralid);
        stringStringHashMap.put("totallmoney", totallmoney);
        stringStringHashMap.put("finallymoney", finallymoney);
        stringStringHashMap.put("freight", freight);
        stringStringHashMap.put("ordertype", ordertype);
        Okhttputils.Instanse(context).postFromBody(headerParams, HttpConfig.BASE_TEST_URL + NewHttpCofig.App_Orederadd, stringStringHashMap, ok, clx);
    }

    /**
     * 查询所有地址
     */
    public static void requestAdress(Context context, Okhttputils.OkutListener listener, Class<? extends BaseEntity> cls) {
        Map<String, String> map_head = RequestParam.getHeaderParams();
        Map<String, String> map_body = new HashMap<>();
        map_body.put("isdefault", "1");
        Okhttputils.Instanse(context).postFromBody(map_head, HttpConfig.BASE_HOST_URL + NewHttpCofig.ADDRESS_SEARCH, map_body, listener, cls);
    }

    /*
    支付
     */
    public static void Apppay(Context context, String type, String orderid, String total_amount, Okhttputils.OkutListener listener, Class<? extends BaseEntity> cls) {
        Map<String, String> map_head = RequestParam.getHeaderParams();
        HashMap<String, String> stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("type", type);
        stringStringHashMap.put("orderid", orderid);
        stringStringHashMap.put("total_amount", total_amount);
        Okhttputils.Instanse(context).postFromBody(map_head, HttpConfig.BASE_HOST_URL + NewHttpCofig.AppPay, stringStringHashMap, listener, cls);
    }

    /**
     * 登录
     */
    public static void Login(Context context, String mobile, String smscode, Okhttputils.OkutListener listener, Class<? extends BaseEntity> cls) {
        HashMap<String, String> stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("mobile", mobile);
        stringStringHashMap.put("smscode", smscode);
        Map<String, String> headerParams = RequestParam.getHeaderParams();
        Okhttputils.Instanse(context).postFromBody(headerParams, HttpConfig.BASE_HOST_URL + NewHttpCofig.Login, stringStringHashMap, listener, cls);
    }

    /**
     * 取消订单
     */
    public static void CancleOrder(Context context, int position, List<OrderShopInfoEntity.DataBean> data, Okhttputils.OkutListener listener, Class<? extends BaseEntity> cls) {
        Map<String, String> map_head = RequestParam.getHeaderParams();
        HashMap<String, String> map_body = new HashMap<>();
        map_body.put("orderid", data.get(position).getOrderid());
        Log.e("orderid======", data.get(position).getOrderid());
        Okhttputils.Instanse(context).postFromBody(map_head, HttpConfig.BASE_HOST_URL + NewHttpCofig.CancleOrder, map_body, listener, cls);
    }

    /**
     * 删除订单
     */
    public static void DeleteOrder(Context context, int position, List<OrderShopInfoEntity.DataBean> data, Okhttputils.OkutListener listener, Class<? extends BaseEntity> cls) {
        Map<String, String> map_head = RequestParam.getHeaderParams();
        HashMap<String, String> map_body = new HashMap<>();
        map_body.put("orderid", data.get(position).getOrderid());
        Log.e("orderid======", data.get(position).getOrderid());
        Okhttputils.Instanse(context).postFromBody(map_head, HttpConfig.BASE_HOST_URL + NewHttpCofig.DeleteOrder, map_body, listener, cls);
    }

    /**
     * 确认收货
     */
//    public static void ConfirmReceipt(Context context, String type, String orderid, Okhttputils.OkutListener listener, Class<? extends BaseEntity> cls) {
//        Map<String, String> map_head = RequestParam.getHeaderParams();
//        HashMap<String, String> map_body = new HashMap<>();
//        map_body.put("type", type);
//        map_body.put("orderid", data.get(position).getOrderid());
//        Okhttputils.Instanse(context).postFromBody(map_head, HttpConfig.BASE_HOST_URL + NewHttpCofig.ConfirmReceipt, map_body, listener, cls);
//    }

    /**
     * 发送验证码
     */
    public static void SendSms(Context context, String phonenum, Okhttputils.OkutListener okutListener) {
        Map<String, String> headerParams = RequestParam.getHeaderParams();
        HashMap<String, String> stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("mobile", phonenum);
        Okhttputils.Instanse(context).postFromBody(headerParams, HttpConfig.BASE_HOST_URL + NewHttpCofig.SMS, stringStringHashMap, okutListener, SmsCodeEntity.class);
    }

    /**
     * 运营发货
     * push
     */
    public static void push(Context context, String orderids, Okhttputils.OkutListener okutListener, Class<? extends BaseEntity> cls) {
        Map<String, String> headerParams = RequestParam.getHeaderParams();
        HashMap<String, String> stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("orderids", orderids);
        Okhttputils.Instanse(context).postFromBody(headerParams, HttpConfig.BASE_HOST_URL + NewHttpCofig.push, stringStringHashMap, okutListener, cls);
    }

    /**
     * 司机查询订单
     */
    public static void driverqurey(Context context, String type, Okhttputils.OkutListener okutListener, Class<? extends BaseEntity> cls) {
        Map<String, String> headerParams = RequestParam.getHeaderParams();
        HashMap<String, String> stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("type", type);
        Okhttputils.Instanse(context).postFromBody(headerParams, HttpConfig.BASE_HOST_URL + NewHttpCofig.cardriverqurey, stringStringHashMap, okutListener, cls);
    }

    public static void cardletadriverqurey(Context context, String orderid, String type, Okhttputils.OkutListener okutListener, Class<? extends BaseEntity> cls) {
        Map<String, String> headerParams = RequestParam.getHeaderParams();
        HashMap<String, String> stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("orderid", orderid);
        stringStringHashMap.put("type", type);
        Okhttputils.Instanse(context).postFromBody(headerParams, HttpConfig.BASE_HOST_URL + "/orderhandle/getdetails", stringStringHashMap, okutListener, cls);
    }

    /**
     * 确认收货
     */
    public static void ConfirmReceipt(Context context, String type, String orderid, Okhttputils.OkutListener listener, Class<? extends BaseEntity> cls) {
        Map<String, String> map_head = RequestParam.getHeaderParams();
        HashMap<String, String> map_body = new HashMap<>();
        map_body.put("orderid", orderid);
        map_body.put("type", type);
        Okhttputils.Instanse(context).postFromBody(map_head, HttpConfig.BASE_HOST_URL + NewHttpCofig.ConfirmReceipt, map_body, listener, cls);
    }

//    /**
//     * 申请退款
//     */
//    public static void ApplyBackMoney(Context context, int position, List<OrderShopInfoEntity.DataBean> data, Okhttputils.OkutListener listener, Class<? extends BaseEntity> cls) {
//        Map<String, String> map_head = RequestParam.getHeaderParams();
//        HashMap<String, String> map_body = new HashMap<>();
//        map_body.put("orderid", data.get(position).getOrderid());
//        Okhttputils.Instanse(context).postFromBody(map_head, HttpConfig.BASE_HOST_URL + NewHttpCofig.ApplyBackMoney, map_body, listener, cls);
//    }

    /**
     * 评价上传
     */
    public static void RemarkPost(Context context, List<File> file, String catid, String level, String value, Okhttputils.OkutListener listener, Class<? extends BaseEntity> cls) {
        Map<String, String> map_head = RequestParam.getHeaderParams();
        HashMap<String, String> map_body = new HashMap<>();
        map_body.put("orderid", catid);
        map_body.put("value", value);
        map_body.put("level", level);
        Okhttputils.Instanse(context).upImgesomes(context, HttpConfig.BASE_HOST_URL + NewHttpCofig.RemarkPost, file, map_head, map_body, listener, cls);
    }

    /**
     * 主页分类
     */
    public static void ecmain(Context context, String type, Okhttputils.OkutListener okutListener, Class<? extends BaseEntity> cls) {
        Map<String, String> headerParams = RequestParam.getHeaderParams();
        HashMap<String, String> stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("type", type);
        Okhttputils.Instanse(context).postFromBody(headerParams, HttpConfig.BASE_HOST_URL + NewHttpCofig.EcMain, stringStringHashMap, okutListener, cls);
    }

    /**
     * 认证状态
     *
     * @param context
     * @param listener
     * @param cls
     */
    public static void quereystatus(Context context, Okhttputils.OkutListener listener, Class<? extends BaseEntity> cls) {
        Map<String, String> headerParams = RequestParam.getHeaderParams();
        Okhttputils.Instanse(context).getnet(headerParams, context, HttpConfig.BASE_HOST_URL + "/shoper/status", listener, cls);
    }

    /**
     * 采摘
     */
    public static void Pick(Context context, String longitude, String latitude, String county, String city, String page, Okhttputils.OkutListener okutListener, Class<? extends BaseEntity> cls) {
        Map<String, String> map_head = RequestParam.getHeaderParams();
        HashMap<String, String> map_body = new HashMap<>();
        map_body.put("longitude", longitude);
        map_body.put("latitude", latitude);
        map_body.put("county", county);
        map_body.put("city", city);
        map_body.put("page", page);
        Okhttputils.Instanse(context).postFromBody(map_head, HttpConfig.BASE_HOST_URL + NewHttpCofig.pick, map_body, okutListener, cls);
    }

    /**
     * 评价查询
     *
     * @param context
     * @param ok
     * @param clx
     */
    public static void remarkqurey(Context context, String type, String catid, Okhttputils.OkutListener ok, Class<? extends BaseEntity> clx) {
        Map<String, String> headerParams = RequestParam.getHeaderParams();
        HashMap<String, String> stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("catid", catid);
        stringStringHashMap.put("type", type);
        Okhttputils.Instanse(context).postFromBody(headerParams, HttpConfig.BASE_HOST_URL + "/remark/search", stringStringHashMap, ok, clx);
    }

    /**
     * 申请退款
     */
    public static void applyBackMoney(Context context, List<File> fileList, String type, String orderid, String money, String backReason, String other, Okhttputils.OkutListener listener, Class<? extends BaseEntity> baseentity) {
        Map<String, String> map_head = RequestParam.getHeaderParams();
        HashMap<String, String> map_body = new HashMap<>();
        map_body.put("type", type);
        map_body.put("orderid", orderid);
        map_body.put("money", money);
        map_body.put("backReason", backReason);
        map_body.put("other", other);
        Log.e("退款参数aa", type + orderid + money + backReason + other);
        Okhttputils.Instanse(context).upImgesomes(context, HttpConfig.BASE_HOST_URL + NewHttpCofig.ApplyBackMoney, fileList, map_head, map_body, listener, baseentity);
    }

    /**
     * 农场商户我的商品
     */
    public static void FarmMyShop(Context context, String type, Okhttputils.OkutListener listener, Class<? extends BaseEntity> cls) {
        Map<String, String> map_head = RequestParam.getHeaderParams();
        HashMap<String, String> map_body = new HashMap<>();
        map_body.put("type", type);
        Okhttputils.Instanse(context).postFromBody(map_head, HttpConfig.BASE_HOST_URL + NewHttpCofig.FarmMyShop, map_body, listener, cls);
    }

    /**
     * 商户上下架
     */
    public static void FarmDownUpCarriage(Context context, String type, String catid, Okhttputils.OkutListener listener, Class<? extends BaseEntity> cls) {
        Map<String, String> map_head = RequestParam.getHeaderParams();
        HashMap<String, String> map_body = new HashMap<>();
        map_body.put("type", type);
        map_body.put("catid", catid);
        Okhttputils.Instanse(context).postFromBody(map_head, HttpConfig.BASE_HOST_URL + NewHttpCofig.DownUpShop, map_body, listener, cls);
    }

    /**
     * 商户全部订单
     */
    public static void FarmAllOrder(Context context, String type, Okhttputils.OkutListener listener, Class<? extends BaseEntity> cls) {
        Map<String, String> map_head = RequestParam.getHeaderParams();
        HashMap<String, String> map_body = new HashMap<>();
        map_body.put("type", type);
        Okhttputils.Instanse(context).postFromBody(map_head, HttpConfig.BASE_HOST_URL + NewHttpCofig.FarmAllOrder, map_body, listener, cls);
    }

    /**
     * 商户获取评论一级列表
     */
    public static void FramGetOneRemark(Context context, Okhttputils.OkutListener listener, Class<? extends BaseEntity> cls) {
        Map<String, String> map_head = RequestParam.getHeaderParams();
        Okhttputils.Instanse(context).getnet(map_head, context, HttpConfig.BASE_HOST_URL + NewHttpCofig.FarmOneRemark, listener, cls);
    }

    public static void Collectiveframqurey(Context context, String catid, Okhttputils.OkutListener ok, Class<? extends BaseEntity> cls) {
        Map<String, String> headerParams = RequestParam.getHeaderParams();
        HashMap<String, String> stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("catid", catid);
        Okhttputils.Instanse(context).postFromBody(headerParams, HttpConfig.BASE_HOST_URL + "/shoper/prodetail", stringStringHashMap, ok, cls);
    }

    /**
     * 提交采摘订单
     */
    public static void commitPickOrder(Context context, String catid, String couponid, String integralid, String totalmoney, String finMoney, String enterTime, String adultNum, String childNum, String teamNum, Okhttputils.OkutListener listener, Class<? extends BaseEntity> cls) {
        Map<String, String> map_head = RequestParam.getHeaderParams();
        HashMap<String, String> map_body = new HashMap<>();
        map_body.put("catid", catid);
        map_body.put("couponid", couponid);
        map_body.put("integralid", integralid);
        map_body.put("totalmoney", totalmoney);
        map_body.put("finMoney", finMoney);
        map_body.put("enterTime", enterTime);
        map_body.put("adultNum", adultNum);
        map_body.put("childNum", childNum);
        map_body.put("teamNum", teamNum);
        Okhttputils.Instanse(context).postFromBody(map_head, HttpConfig.BASE_HOST_URL + NewHttpCofig.pickOrder, map_body, listener, cls);
    }

    /**
     * 提交商户审核信息
     */
    public static void applyFarm(Context context, List<File> file, String name, String sex, String phone, String IDcard, String farmAddress, String farmScale, String type, Okhttputils.OkutListener listener, Class<? extends BaseEntity> cls) {
        Map<String, String> map_head = RequestParam.getHeaderParams();
        HashMap<String, String> map_body = new HashMap<>();
        map_body.put("name", name);
        map_body.put("sex", sex);
        map_body.put("phone", phone);
        map_body.put("IDcard", IDcard);
        map_body.put("farmAddress", farmAddress);
        map_body.put("farmScale", farmScale);
        map_body.put("type", type);
        Okhttputils.Instanse(context).upImgesomes(context, HttpConfig.BASE_HOST_URL + NewHttpCofig.applyFarm, file, map_head, map_body, listener, cls);
    }

    /**
     * 商户发布商品
     */
    public static void FarmReleaseShop(Context context, List<File> file, String proName, String staTime, String endTime, String num, String address, String longitude, String latitude, String adult, String child, String team, String teamNum, String province, String c, String county, String wifi, Okhttputils.OkutListener listener, Class<? extends BaseEntity> cls) {
        Map<String, String> map_head = RequestParam.getHeaderParams();
        HashMap<String, String> map_body = new HashMap<>();
        map_body.put("proName", proName);
        map_body.put("staTime", staTime);
        map_body.put("endTime", endTime);
        map_body.put("num", num);
        map_body.put("address", address);
        map_body.put("longitude", longitude);
        map_body.put("latitude", latitude);
        map_body.put("adult", adult);
        map_body.put("child", child);
        map_body.put("team", team);
        map_body.put("teamNum", teamNum);
        map_body.put("province", province);
        map_body.put("city", c);
        map_body.put("county", county);
        map_body.put("wifi", wifi);
        Okhttputils.Instanse(context).upImgesomes(context, HttpConfig.BASE_HOST_URL + NewHttpCofig.ReleaseShop, file, map_head, map_body, listener, cls);
    }

    /**
     * 热搜商品
     */
    public static void hotSearch(Context context, Okhttputils.OkutListener listener, Class<? extends BaseEntity> cls) {
        Map<String, String> map_head = RequestParam.getHeaderParams();
        Okhttputils.Instanse(context).getnet(map_head, context, HttpConfig.BASE_HOST_URL + NewHttpCofig.hotSearch, listener, cls);
    }

    /**
     * 取消商户审核信息
     */
    public static void cancleFarmDecide(Context context, Okhttputils.OkutListener listener, Class<? extends BaseEntity> cls) {
        Map<String, String> map_head = RequestParam.getHeaderParams();
        Okhttputils.Instanse(context).getnet(map_head, context, HttpConfig.BASE_HOST_URL + NewHttpCofig.cancelFarmApply, listener, cls);
    }

    /**
     * 打电话
     */
    public static Intent phone() {
        return new Intent(Intent.ACTION_CALL, Uri.parse("tel:400-0011-857"));

    }

    /**
     * 申请优惠券
     */
    public static void obtainCoupon(Context context, String type, Okhttputils.OkutListener listener, Class<? extends BaseEntity> cls) {
        Map<String, String> map_head = RequestParam.getHeaderParams();
        HashMap<String, String> map_body = new HashMap<>();
        map_body.put("type", type);
        Okhttputils.Instanse(context).postFromBody(map_head, HttpConfig.BASE_TEST_URL + NewHttpCofig.coupon, map_body, listener, cls);
    }

    /**
     *
     * */
    public static void canUseCoupon(Context context, String type, String money, Okhttputils.OkutListener listener, Class<? extends BaseEntity> cls) {
        Map<String, String> map_head = RequestParam.getHeaderParams();
        HashMap<String, String> map_body = new HashMap<>();
        map_body.put("type", type);
        map_body.put("money", money);
        Okhttputils.Instanse(context).postFromBody(map_head, HttpConfig.BASE_TEST_URL + NewHttpCofig.coupon, map_body, listener, cls);
    }
}